/*
 * @Description:
 * @Author: LCL
 * @Date: 2021-11-15
 * @LastEditors: LCL
 * @LastEditTime: 2021-11-22
 * @FilePath: /beff/src/models/components.ts
 */

import { useState } from 'react';

export default () => {
  const [componentsConfig, setComponentsConfig] = useState({
    checkbox: {
      options: [
        { label: '选项1', value: '值1', check: false },
        { label: '选项2', value: '值2', check: false },
      ],
      value: [],
      direction: 'vertical',
    },
    datePicker: {},
    commonForm: {
      required: false,
      label: '子表单',
      name: 'subForm',
      layout: 'vertical',
    },
    upload: {
      name: 'file',
      listType: 'picture',
      disabled: false,
      maxCount: 10,
      drag: false,
    },
    subForm: {
      type: 'subForm',
      stickyColumn: { enable: false, limit: 0 },
      children: [],
    },
    formEvent: [
      {
        description: '这是一段描述',
        enabled: false,
        id: '343dd33',
        name: '请求数据',
        trigger: 'input',
      },
    ],
  });
  return {
    componentsConfig,
    setComponentsConfig,
  };
};
